import datetime


class Account:
    def __init__(self, category, account, money, balance, time, comment):
        self.category = category
        self.account = account
        self.money = money
        self.balance = balance
        self.time = time
        self.comment = comment

    @staticmethod
    def income(account, money, balance, comment):
        time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
        balance += money
        record = Account('收入', account, money, balance, time, comment)
        return [record, balance]

    @staticmethod
    def expend(account, money, balance, comment):
        time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
        balance -= money
        return Account('支出', account, money, balance, time, comment), balance
